<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="chart-name" content="测评统计">
    <title>测评统计</title>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="height:200px;"></div>
<!-- ECharts单文件引入 -->
<script src="http://echarts.baidu.com/build/dist/echarts-all.js"></script>
<script src="../static/js/jquery-3.2.1.min.js"></script>
<script src="../static/js/vue.js"></script>
<script src="../static/js/vue-resource.min.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts图表


    var vue = new Vue({

        data: {
            userId:'[[${userId}]]',
            scores: []
        },
        methods: {},
        created: function () {
            this.$http.get("/base/common/line_data2",{params:{userId:this.userId}}).then(function (res) { {
            var data = res.data.data;
            var myChart = echarts.init(document.getElementById('main'));

            var option = {

                tooltip: {
                    trigger: 'axis',
                    backgroundColor:'#F7C497',
                    borderColor:'#f7f7f7',
                    borderRadius:2,
                    textStyle:{
                        color:"#556B2F",
                        fontSize:'10'
                    },
                    axisPointer:{
                        type: 'line',
                        lineStyle: {
                            color: '#FF8C00',
                            width: 1,
                            type: 'solid'
                        },
                        crossStyle: {
                            color: '#1e90ff',
                            width: 1,
                            type: 'dashed'
                        },
                        shadowStyle: {
                            color: 'rgba(150,150,150,0.3)',
                            width: 'auto',
                            type: 'default'
                        }
                    }
                },
                legend: {
                    show: false,
                    data: ['分值']
                },
                grid: {
                    y:10,
                    x:30,
                    x2:30,
                    y2:30,
                    borderWidth:0,
                    backgroundColor: '#f7f7f7'
                },
                calculable: true,
                xAxis: [
                    {
                        type: 'category',
                        axisLine: {
                            show: true,
                            lineStyle: {color: '#f7f7f7'}
                        },
                        splitLine: {
                            show: false, lineStyle: {
                                type: 'solid'
                            }
                        },//去除网格线
                        boundaryGap: false,
                        data: data.datas
                    }
                ],

                yAxis: [
                    {
                        type: 'value',
                        max:50,
                        axisLine: {
                            show: true,
                            lineStyle: {color: '#FFF5EE'}
                        },
                        axisTick:{
                            color: '#333',
                            width: 1
                        },
                        splitLine: {
                            show: true,
                            lineStyle: {
                                type: 'dotted'
                            }
                        },
                    }
                ],
                series: [
                    {
                        name: '分值',
                        type: 'line',
                        smooth: true,
                        itemStyle: {normal: {  color: "rgba(247,196,151,0.9)",lineStyle:{
                                    color:'rgba(247,196,151,0.9)'
                                },areaStyle: {color: 'rgba(247,196,151,0.7)', type: 'default'}}},
                        data:data.scores
                    }
                ]
            };

            // 为echarts对象加载数据
            myChart.setOption(option);

        }})
        }
    });











</script>
</body>
</body>

</html>
